<?php 
Header("Content-type: text/plain; charset=utf-8");
?>
ID,TIME,LATITUDE,LONGITUDE,ALTITUDE,SPEED
<?php while ( list($id, $pointdata) = each ($data["coordinates"])): ?>
<?php printf("%d",$id); ?>,<?php print $pointdata["time_received"]; ?>,<?php printf("%.5f",$pointdata["lat"]); ?>,<?php printf("%.5f",$pointdata["lon"]); ?>,<?php printf("%.1f",$pointdata["alt"]); ?>,<?php printf("%.1f",$pointdata["speed"]); ?>

<?php endwhile; ?>

